package day01;

import java.util.Scanner;

/**
 * 计算个人所得税以及税后工资,题目这里不复制过来了
 * 要使用快捷键 CTRL + alt + L
 *
 * @since 15:27
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class IfMultiBranchDemo {
    public static void main(String[] args) {
        System.out.println("请输入工资");
        Scanner sc = new Scanner(System.in);
        //工资salary；税率percent；速算扣除数cut；应纳税额tax；到手工资result
        int salary = sc.nextInt();
        salary -= 2000;
        int percent;
        int cut;
        if (salary <= 500) {
            percent = 5;
            cut = 0;
        } else if (salary <= 2000) {
            percent = 10;
            cut = 25;
        } else if (salary <= 5000) {
            percent = 15;
            cut = 125;
        } else if (salary <= 20000) {
            percent = 20;
            cut = 375;
        } else if (salary <= 40000) {
            percent = 25;
            cut = 1375;
        } else if (salary <= 60000) {
            percent = 30;
            cut = 3375;
        } else if (salary <= 80000) {
            percent = 35;
            cut = 6375;
        } else if (salary <= 100000) {
            percent = 40;
            cut = 10375;
        } else {
            percent = 45;
            cut = 15375;
        }
        double tax;
        tax = salary / 100.0 * percent - cut;
        double result;
        result = salary + 2000 - tax;
        System.out.println("缴纳的个税是：" + tax);
        System.out.println("到手的工资是：" + result);
        sc.close();
    }
}
